<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

/**
 * 订单评价验证器
 */
class OrderRatingValidate extends Validate
{
    /**
     * 定义验证规则
     */
    protected $rule = [
        'order_id'                => 'require',
        'itinerary_rating'        => 'require',
        'service_attitude_rating' => 'require',
        'professionalism_rating'  => 'require',
        'punctuality_rating'      => 'require',
    ];

    /**
     * 定义错误信息
     */
    protected $message = [
        'order_id'                => '关联的订单ID必须填写',
        'itinerary_rating'        => '行程合理性评分必须填写',
        'service_attitude_rating' => '服务态度评分必须填写',
        'professionalism_rating'  => '专业程度评分必须填写',
        'punctuality_rating'      => '守时评分必须填写',
    ];

    /**
     * 定义场景
     */
    protected $scene = [
        'save'   => [
            'order_id',
            'itinerary_rating',
            'service_attitude_rating',
            'professionalism_rating',
            'punctuality_rating',
            'create_time',
            'update_time',
        ],
        'update' => [
            'order_id',
            'itinerary_rating',
            'service_attitude_rating',
            'professionalism_rating',
            'punctuality_rating',
            'create_time',
            'update_time',
        ],
    ];

}
